<?php
/**
 * CreateTime: 2023/11/17 14:54
 * User:LinQ
 */

namespace Database\Seeders\System;


use Illuminate\Database\Seeder;


class PvPuKeySeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // 检查是否已经生成过了
        if(!is_file((__DIR__."/pu_key.pem"))||!is_file((__DIR__."/pv_key.pem"))){
            $puPvKey = rsa_pu_pv_key();
            touch(__DIR__."/pu_key.pem");
            file_put_contents(__DIR__."/pu_key.pem",$puPvKey['pu_key']);
            touch(__DIR__."/pv_key.pem");
            file_put_contents(__DIR__."/pv_key.pem",$puPvKey['pv_key']);
        }


    }
}